﻿using System;
using System.Collections;
using System.Linq;

namespace LightCAD.MathLib
{
    public interface IIOArray
    {
        IIOArray FromArray(double[] array, int offset);
        double[] ToArray(double[] array = null, int offset = 0);
        bool Equals(IIOArray obj);
    }

    public static class IOArrayExt
    {
        public static float[] ToArray(this IIOArray ioArr, float[] array = null, int offset = 0)
        {
            var tempArry = new double[array.Length];
            ioArr.ToArray(tempArry, offset);
            for (int i = offset; i < array.Length; i++)
            {
                array[i] = (float)tempArry[i];
            }
            return array;
        }
    }
}
